<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Author" content="cjw">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>店铺管理分页面中的-模块-主要模块</title>
  <link type="text/css" rel="stylesheet" href="../css/MyCss.css" />
  <link type="text/css" rel="stylesheet" href="../css/base.css" />
  <style>
	*{margin: 0; padding: 0;}
	.infor-nav-con,.goods-nav-con,.flip-advert-con,.part1-con,.part2-con, .body-con {width:1100px; margin:auto;}
	.goods-area-part1, .goods-area-part2, .part2-con, .goods-nav-con, .goods-body {overflow:hidden;}
	ul {list-style-type:none;}
	/* S - infor-nav */
	.infor-nav {width:100%; position:relative; background:#555;}
	.infor-nav .infor-nav-con {height:40px;}
	.infor-nav .infor-nav-con ul {}
	.infor-nav .infor-nav-con ul li {float:left; color:#fff; width:200px; margin:12px 0px;}
	.infor-nav .infor-nav-con ul li:nth-child(3) {width:300px;}  
	.infor-nav .infor-nav-con ul li .my-cart-i{background:url(image/my-cart.png); }
	.infor-nav .infor-nav-con ul li:last-child {float:right;}
	.infor-nav .infor-nav-con label{cursor:pointer;}
	.infor-nav .infor-nav-con label:hover{color:#f6f4f0;}
	/* E - infor-nav */

	/* S - follow-box */
	.follow-box{width:100%; top:0; height:50px; background:#555; display:none; position:fixed;}
	/* E - follow-box */

	/* S - goods-nav */
	.shop-nav,.shop-icon {float:left;}
	.goods-nav{width:100%; border-bottom:1px solid rgba(204, 207, 208, 0.26)}
	.goods-nav .goods-nav-con { height:20px; padding:30px 2px;}
	.goods-nav .goods-nav-con .shop-icon {}
	.goods-nav .goods-nav-con .shop-icon a{background:url(../image/store_ico.png);width: 48px;height: 48px;display: block;cursor:pointer; margin:-14px 10px;}
	.goods-nav .goods-nav-con .shop-nav {margin-left:80px;}
	.goods-nav .goods-nav-con .shop-nav ul li {float:left; width:60px; height:25px; text-align:center; line-height:25px; cursor:pointer;}
	.goods-nav .goods-nav-con .shop-nav ul li:hover{background:#555; color:#f6f4f0;}
	.goods-nav .goods-nav-con .shop-nav ul li:nth-child(1) {background:#555; color:#f6f4f0;}
	.goods-nav .goods-nav-con .shop-search {float:right;}
	.goods-nav .goods-nav-con .shop-search input {padding-left:30px;}
	.goods-nav .goods-nav-con .shop-search .shop-search-i {background:url(../image/shop_search.png); opacity:0.5; position:absolute; cursor:pointer;}
	.goods-nav .goods-nav-con .shop-search .shop-search-i:hover{opacity:1;}
	/* E - goods-nav */

	.main_box{width:1000px; height:800px; background:#fff; margin:auto; font-size:12px;}
	.main_box i{display:block; width:16px; height:16px;}
	.main_box ul {list-style-type:none;}
	
	/*左边导航*/
	.main_box .left_nav{width:166px; height:100%; border:1px solid #ddd; float:left;}
	.left_nav li{width:100%; height:25px; border-bottom:1px solid #ddd; color:#555; cursor:pointer; text-align:center; font-size:14px; line-height:25px;}
	.left_nav li:hover{background:#555; color:#fff;}

	/*右边内容*/
	.main_box .right_con{width:831px; height:100%; border:1px solid #ddd; float:left; border-left:none;}
	.con_order, .con_sales, .con_goods, .con_manage{display:none;}
	.order_nav,.sales_nav,.con_Title,.sales_Title{border-bottom:1px solid #ddd; overflow:hidden;}
	.con_Title,.sales_Title{height:50px;}
	.right_con .order_nav li {float:left; width:120px; height:35px; text-align:center; line-height:40px; color:#555; cursor:pointer;}
	.right_con .sales_nav li {float:left; width:120px; height:35px; text-align:center; line-height:40px; color:#555; cursor:pointer;}

	.order_new,.order_ing,.order_ed, .sales_new,.sales_ing,.sales_ed{width:100%; height:712px;}
	.order_ing,.order_ed, .sales_ing,.sales_ed {display:none;}

	.sales_new,.sales_ing,.sales_ed {}
	.sales_ing,.sales_ed {}

	.con_Title label:nth-child(1){float:left; }
	.con_Title label:last-child{float:right; }
	.con_Title label input {margin:17px 11px; border:none; width:160px; height:25px; padding-left:25px; border-radius:5px; color:#9c9797;}
	.con_Title .search_i {position:absolute; margin:22px 15px; background:url(../image/manage/search.png); cursor:pointer;}
	.con_Title .search_i:hover{background:url(../image/manage/search_hover.png); cursor:pointer;}
	.con_Title span, .sales_Title span {width: 140px; height: 27px;display: block; font-size: 20px; font-family: sans-serif; color: #7b7b7a; margin: 0px 30px; padding-top: 10px; border-bottom: 4px solid #ccc;}

	.manage_con > .more-oprate, .goods_con > .more-oprate {width: 98.5%; border:1px solid #fff; background:#fff; height:30px; padding: 3px 4px; position:relative;}/*manage_con goods_con*/
	
	.goods_con{padding:5px; height: 700px;}
	.goods_con > .deailed {height:701px; overflow:hidden; overflow-y:auto; border-bottom: 1px solid rgba(204, 207, 208, 0.26);}
	.goods_con > .more-oprate {width: 98.5%; border:1px solid #fff; background:#fff; height:30px; padding: 3px 4px;}
	.goods_con > .more-oprate > .manage-sure {display:none;}
	.goods_con > .more-oprate > .add-con {position:absolute; width:0px; border:1px solid #ccc; height:0px; margin:45px 0px; bottom:0px; overflow:hidden; display:none; background: #fff;}
	.goods_con > .more-oprate > .add-con > label {display: block;}
	.goods_con > .more-oprate > .add-con > label label {float:left; display: block; padding: 2px; line-height:70px;}
	.goods_con > .more-oprate > .add-con > label label input[type="text"]{width: 150px; height: 22px; border: 0px; background:rgba(0,0,0,0); text-align: center; cursor:pointer; color:#555; font-family: sans-serif; }
	.goods_new,.goods_ing,.goods_ed {width:744px; height:500px; background:#ddd;}
	.goods_ing,.goods_ed {display:none; }

	.goods_new,.goods_ing,.goods_ed{overflow-y:auto;overflow-x:hidden;}
	.con_goods table{text-align:center; width:820px;}
	.con_goods table tbody tr{}
	.con_goods table tbody tr:hover{box-shadow:1px 1px 8px -1px #555;}
	.con_goods table tbody .tr_top{background:#ccc; height:35px;}
	.con_goods table tbody .tr_addsingular{background: #b8d9e8;}
	.con_goods table tbody tr td{border-bottom:1px solid rgba(204, 207, 208, 0.26); padding: 2px; }
	.con_goods table tbody tr td img {display: block;}
	.con_goods table tbody tr td input[type="text"]{width: 150px; height: 22px; border: 0px; background:rgba(0,0,0,0); text-align: center; cursor:pointer; color:#555; font-family: sans-serif; }
	.con_goods table tbody tr .oprate_td{width:26px;}
	.con_goods table tbody tr td:last-child{width:60px;}

	.update_i {background: url(../image/manage/update.png); cursor:pointer;}
	.update_i:hover {background: url(../image/manage/update_hover.png);}
	.delete_i {background: url(../image/manage/dele.png); cursor:pointer;}
	.delete_i:hover {background: url(../image/manage/dele2.png);}
	.sure_i {background: url(../image/manage/sure.png); cursor: pointer; display: none;}
	.manage_con {padding: 5px;}
	.detailed {padding:0 25px; height:701px; border-bottom: 1px solid rgba(204, 207, 208, 0.26);}
	.manage_con > .detailed > label {overflow:hidden; display:block; margin:35px;}
	.manage_con > .detailed > label > label {float: left; display:block; line-height: 30px;}
	.manage_con > .detailed > label > label:nth-child(1) {width: 78px;}
	.manage_con > .detailed > label .address-con > label {overflow:hidden; display:block; margin:10px -10px;}
	.manage_con > .detailed > label .address-con > label:nth-child(1){margin:1px -10px;}
	.manage_con > .detailed > label .address-con > label label {float: left; display:block; line-height: 30px;}
	.manage_con > .detailed > label .address-con .input-button {color:#555; width: 78px; height: 25px; display: none;}
	.manage_con > .detailed > label .address-con .input-button:hover {background:#ddd;}
	.manage_con > .detailed > label .address-con  select {background: #f6f4f0;}
	.manage_con > .detailed > label input {border:none; background: #f6f4f0;}
	.manage_con > .detailed > h1 {font-size:16px;}
	.manage_con > .more-oprate > .manage-sure {display:none;}
	.manage_con > .detailed .input_address {color: #777171; background: #fff;}
	

	/* S - 订单 */
	.order_con {overflow:hidden;}
	.order_con .order i{display: block; width: 16px; height: 16px;}
	.order_con .order img{display: block;}
	.order_con .order {width:680px; color:#ccc; padding:5px; border:1px solid #ddd; font-size:12px; margin:20px auto; overflow:hidden;}
	.order_con .order .top{height: 25px;}
	.order_con .order .con{}
	.order_con .order .con ul li{list-style-type:none; border:1px solid #ddd; padding:6px; margin-top:2px;}
	.order_new .order .con ul li .busi_name{height:22px; font-size:14px; font-weight:bold;}
	.order_con .order .con ul li table{}
	.order_con .order .con ul li table tbody tr{}
	.order_con .order .con ul li table tbody tr td{text-align: center; width:126px; color:#ccc;     padding: 2px; border-bottom:1px solid #ddd; border-right:1px solid #ddd;}

	.order_con .order .con ul li table tbody tr:nth-child(1) td{border-top:1px solid #ddd;}
	.order_con .order .con ul li table tbody tr td:nth-child(1){width:100px; border-left:1px solid #ddd; }
	.order_con .order .con ul li table tbody tr td:nth-child(2){width:160px;}
	.order_con .order .con ul li table tbody tr td:nth-child(3){}
	.order_con .order .con ul li table tbody tr td:nth-child(4){}
	.order_con .order .con ul li table tbody tr td:nth-child(5){}
	.order_con .order .con ul li table tbody .busi_name td{text-align:left; height:20px; padding-left:3px; border-top:1px solid #ddd;}
	.order_con .order .con ul li .li_bom{height:16px; overflow:hidden;} /*16px;46px;*/
	.order_con .order .con ul li .li_bom .order_state{height:16px;}
	.order_con .order .con ul li .li_bom .order_state label{float:right;}
	.more_infor:hover, .label_logistics:hover{color:#555; cursor:pointer;}
	.order_con .order .con ul li .li_bom .order_logistics{height:18px; background:#f6f4f0; 
	padding:6px; }
	.order_con .order .order_logistics label{display:block; float:left;}
	.order_con .order .order_logistics label:nth-child(2){width:24px; height:1px; margin-left: 10px;}

	.order_con .order .order_logistics .sure_order{float:right; width:60px; height:18px; text-align:center; color:#fff; border-radius:4px; background:#e6b981; cursor:pointer;}
	.sure_order{line-height:18px;}
	.order_con .order .order_logistics .sure_order:hover{background:#f58536}
	.order_con .order .order_logistics .select_address{width: 200px; height: 25px; background: none; border: none; margin: -4px 0; color:#ccc; outline: none;}

	.order_con .order .bom{}
	.order_con .order .bom .money_space,.order_con .order .bom .money,.order_con .order .bom .original_money{float:right;}

	
	/* E - 订单 */

	/* S - foot */
	.foot{min-height:50px;}
	.bom_container{height:40px; width:900px; border-bottom:1px solid #ccc; margin:auto;}
	/* E - foot */
  </style>
 </head>
 <body>	
	<!--S - infor-nav-->
	<div class="infor-nav">
		<div class="infor-nav-con">
			<!--登录 注册 我的订单 我的个人信息 购物车 -->
			<ul>
				<li>
					<label class="dear_boss">老板您好</label>&nbsp;&nbsp;&nbsp;&nbsp;
					<label>注册</label>
				</li>
				<li></li>
				<li></li>
				<li>
					<label class="my-infor">管理店铺</label>&nbsp;&nbsp;
					<label class="my-order">查看订单</label>&nbsp;&nbsp;
					<label class="my-cart">销售</label>
				</li>
			</ul>
		</div>
	</div>
	<!--E - infor-nav-->

	<!--S - follow-box-->
	<div class="follow-box"></div>
	<!--E - follow-box-->

	<!--S - goods-nav-->
	<div class="goods-nav">
		<div class="goods-nav-con">
			<div class="shop-icon">
				<a href="../index.html"></a>
			</div>
			<div class="shop-nav">
				<ul>
					<li>服装</li>
					<li>日用品</li>
					<li>食品</li>
					<li>电子产品</li>
					<li>高科技</li>
				</ul>
			</div>
			<!--查找-->
			<div class="search" id="search">
				<input type="text" placeholder="请输入要商品关键字" id="search_text">
				<input type="button" value="搜索本店" id="search_button">
				<!--搜索结果显示区-->
				<div class="search_show" id="search_show"></div>
			</div>
		</div>
	</div>
	<!--E - goods-nav-->

	<div class="main_box">
		<!--左边导航-->
		<div class="left_nav">
			<ul>
				<!--order 订单,sales 销售,goods 商品-->
				<li class="order">订单</li>
				<li class="sales">销售</li>
				<li class="goods">商品</li>
				<li>店铺</li>
			</ul>
		</div>
		<!--右边内容-->
		<!--
			left-nav-cnt
				这是默认对应上面li的容器每一个对应容器都闭需添加
		-->
		<div class="right_con">
			<!--订单-->
			<div class="con_order left-nav-cnt">
				<div class="con_Title">
					<label>
						<span>订单内容</span>
					</label>
					<label>
						<i class="search_i"></i>
						<input class="goods_search" placeholder="输入要查找的订单编号" type="text" />
					</label>
				</div>
				<div class="order_nav">
					<ul>
						<li>新的订单</li>
						<li>正在交易</li>
						<li>成交订单</li>
					</ul>
				</div>
				<div class="order_con">
					<!--新的订单-->
					<div class="order_new">
						<ul>
							
						</ul>
					</div>
					<!--正在交易-->
					<div class="order_ing">
						<ul>
							
						</ul>
					</div>
					<!--过去订单-->
					<div class="order_ed">
						<ul>
							
						</ul>
					</div>
				</div>
			</div>
			<!--销售-->
			<div class="con_sales left-nav-cnt">
				<div class="sales_Title">
					<label>
						<span>销售情况</span>
					</label>
				</div>
				<div class="sales_nav">
					<ul>
						<li>最近7天</li>
						<li>过去一个月</li>
						<li>过去一年</li>
					</ul>
				</div>
				<div class="sales_con">
					<!--最近7天-->
					<div class="sales_new"></div>
					<!--过去一个月-->
					<div class="sales_ing"></div>
					<!--过去一年-->
					<div class="sales_ed"></div>
				</div>
			</div>
			<!--商品-->
			<div class="con_goods left-nav-cnt">
				<div class="con_Title">
					<label>
						<span>商品内容</span>
					</label>
					<label>
						<i class="search_i"></i>
						<input placeholder="输入要查找的商品名称" class="goods_search" type="text" />
					</label>
				</div>
				<div class="goods_con">
					<!--
					<table cellspacing="0" cellpadding="0">
						<tbody id="dele_tbody">
							<tr class="tr_top">
								<td>名称</td>
								<td>价格</td>
								<td>尺寸</td>
								<td>颜色</td>
							</tr>
						</tbody>
					</table>
					-->
					<div class="deailed">
						<table class="goods_table" cellspacing="0" cellpadding="0">
							<tbody id="goods_list">
								<!--
								<tr class="" data-id="1">
									<td>
										<img src="" width="55" height="60" alt="" title="点击更换图片">
									</td>
									<td><input type="text" value="好看的上衣"></td>
									<td><input type="text" value="120"></td>
									<td><input type="text" value="S-L-XL"></td>
									<td><input type="text" value="红色-卡其色-棕色"></td>
									<td class="oprate_td"><i class="update_i"></i></td>
									<td class="oprate_td"><i class="delete_i"></i></td>
									<td class="oprate_td">
										<i class="sure_i" style="display:none;" title="确认修改"></i>
									</td>
								</tr>
								<tr class="" data-id="2">
									<td>
										<img src="" width="55" height="60" alt="" title="点击更换图片">
									</td>
									<td><input type="text" value="好看的上衣"></td>
									<td><input type="text" value="120"></td>
									<td><input type="text" value="S-L-XL"></td>
									<td><input type="text" value="红色-卡其色-棕色"></td>
									<td class="oprate_td"><i class="update_i"></i></td>
									<td class="oprate_td"><i class="delete_i"></i></td>
									<td class="oprate_td">
										<i class="sure_i" style="display:none;" title="确认修改" ></i>
									</td>
								</tr>
								<tr class="" data-id="3">
									<td>
										<img src="" width="55" height="60" alt="" title="点击更换图片">
									</td>
									<td><input type="text" value="好看的上衣"></td>
									<td><input type="text" value="120"></td>
									<td><input type="text" value="S-L-XL"></td>
									<td><input type="text" value="红色-卡其色-棕色"></td>
									<td class="oprate_td"><i class="update_i" title="点击进行修改"></i></td>
									<td class="oprate_td"><i class="delete_i" title="点击进行删除"></i></td>
									<td class="oprate_td"><i class="sure_i" style="display:none;" title="确认修改"></i></td>
								</tr>
								<tr class="" data-id="">
									<td>
										<img src="" width="55" height="60" alt="" title="点击更换图片">
									</td>
									<td><input type="text" value=""></td>
									<td><input type="text" value=""></td>
									<td><input type="text" value=""></td>
									<td><input type="text" value=""></td>
								</tr>
								-->
							</tbody>
						</table>
					</div>
					<div class="more-oprate">
						<div class="add-con">
							<label class="" data-id="">
								<i class="close_ico"></i>
								<form id="f_goods" method="post" action="addGoods" enctype="multipart/form-data">
									<label>
										<img id="uploadImg" src="" width="55" height="60" alt="" title="点击更换图片"  />
									</label>
									<input id="imgFile" type="file" name="file" style="display:none;" />
									<label>
										<input class="goods-name" name="goodsName" type="text" placeholder="商品名称" value="">
									</label>
									<label>
										<input class="goods-price" name="goodsPrice" type="text" placeholder="商品价格" value="">
									</label>
									<label>
										<input class="goods-sizes" name="goodsSizes" type="text" placeholder="尺码种类" value="">
									</label>
									<label>
										<input class="goods-colors" name="goodsColors" type="text" placeholder="颜色种类" value="">
									</label>
									<input class="goods-reset" type="reset" style="display:none;" />
									<input class="goods-submit" type="submit" style="display:none;" />
								</form>
							</label>
						</div>
						<input class="input-button manage-update" type="button" value="添加" />
						<input class="input-button manage-sure" type="button" value="确认"/>
					</div>
				</div>
			</div>
			<!--店铺-->
			<div class="con_manage left-nav-cnt">
				<div class="sales_Title">
					<label>
						<span>店铺管理</span>
					</label>
				</div>
				<div class="manage_con">
					<div class="detailed">
						<h1>店铺信息</h1>
						<label>
							<label>店名：</label>
							<label><input class="storeName input-text" type="text" disabled/></label>
						</label>
						<label>
							<label>销售记录：</label>
							<label><input class="input-text" type="text" disabled/></label>
							<label><i></i></label>
						</label>
						<label>
							<label>积分：</label>
							<label><input class="integral input-text" type="text" disabled/></label>
						</label>
						<h1>个人信息</h1>
						<label>
							<label>真实姓名：</label>
							<label><input class="trueName input-text" type="text" disabled/></label>
							<label><i></i></label>
						</label>
						<label>
							<label>性别：</label>
							<label><input class="sex input-text" type="text" disabled/></label>
							<label><i></i></label>
						</label>
						<label>
							<label>手机号：</label>
							<label><input class="pNumber input-text" type="text" disabled/></label>
							<label><i></i></label>
						</label>
						<label>
							<label>邮箱：</label>
							<label><input class="email input-text" type="text" disabled/></label>
							<label><i></i></label>
						</label>
						<label>
							<label>地址：</label>
							<label class="address-con">
								<label class="add-label"><input type="button" class="input-button add" value="添加" /></label>
								<!--
								<label>
									<label>
										<select class="select-button" disabled>
											<option>省份</option>
											<option>1</option>
											<option>2</option>
											<option></option>
											<option></option>
										</select>
									</label>
									<label>
										<select class="city select-button" disabled>
											<option>城市</option>
											<option>1</option>
											<option>2</option>
											<option></option>
											<option></option>
										</select>
									</label>
									<label>
										<input class="street input-text" type="text"/>
									</label>
									<label><i class=""></i></label>
									<!--
									<input name="username" class="input-text" type="text" disabled/>
									
								</label>
								-->
							</label>
						</label>
					</div>
					<div class="more-oprate">
						<input class="input-button manage-update" type="button" value="修改" />
						<input class="input-button manage-sure" type="button" value="确认"/>
					</div>
				</div>
			</div>
		</div>
		<form id="f_upload" method="post" action="addImage" enctype="multipart/form-data" style="display:none;">
			<input class="upload" type="file" onchange="upload_bt.click()" name="file"/>
			<input class="id-text" type="text" name="goodsId" />
			<input id="upload_bt" type="submit" />
		</form>
	</div>

	<!--S -  foot-->
	<div class="foot">
		<div class="bom_container">
			<li style="color:#586069;list-style:none;padding:10px 245px;">Copyright ©2017 <span  style="color:#a71d5d;cursor:pointer;" title="作者介绍">chen</span> Powered By <span  style="color:#a71d5d;cursor:pointer;" title="程序目录">shop_net</span> Version 1.0.0</li>
		</div>
	</div>
	<!--E - foot-->
	<script src="../js/Order_Mudle7.js"></script>
	<script src="../js/MyjsV0-8.js"></script>
	<script>
	var merchant = {
		parame:new Map(), //集中管理全局参数
		leftNav:function(index){		//左导航
			new liEvent_2({
				liElements:$(".left_nav")[0].$("li"),
				initIndex:index,
				initStyle:"definFun",
				cntElements:$(".right_con")[0].$(".left-nav-cnt"),
				definFun:function(nowEle){
					var lis = $(".left_nav")[0].$("li") ;
					for(var i = 0; i < 4; i++){
						lis[i].css("background: rgb(246, 244, 240); ", false) ; 
					}
					nowEle.css("background:#555; color:#fff;", false) ;
				}
			}).doReady() ;
		},
		rightContent:function(){ //右边的内容
			new liEvent_2({
				initStyle:"definFun",
				cntElements:[$(".order_new")[0], $(".order_ing")[0], $(".order_ed")[0]],
				liElements:$(".order_nav")[0].$("li"),
				definFun:function(e){
					var lis = $(".order_nav")[0].$("li") ;
					var lis2 = $(".sales_nav")[0].$("li") ;
					for(var i = 0; i < 3; i++){
						lis[i].css("background: rgb(246, 244, 240);", false) ;
						lis2[i].css("background: rgb(246, 244, 240);", false) ;
					}
					$(".order_nav")[0].$("li")[0].css("background:#555; color:#fff;", false) ;
					$(".sales_nav")[0].$("li")[0].css("background:#555; color:#fff;", false) ;
					//商铺中的订单样式修改代码 特定修改
					var orders = $(".order_con")[0].$(".order") ;
					for(var i = 0; i < orders.length; i ++){
						orders[i].$("li")[0].css("border:none; padding:0;", false) ;
						orders[i].css("width:720px;", false) ;
					}
				}
			}).doReady() ;
			/*销售 - 销售情况*/
			new liEvent_2({
				cntElements:[$(".sales_new")[0], $(".sales_ing")[0], $(".sales_ed")[0]],
				liElements:$(".sales_nav")[0].$("li"),
			}).doReady() ;
		},
		firstBool:true,
		initPage:function(){	//初始化页面
			merchant.initData.put("orderList", "0000") ;
			merchant.initData.put("goodsList", "0002") ;
			merchant.initData.put("infor", "0003") ;
			ajax({
				type:"post",
				url:"merchantManage_initPage",
				data:{data:"0000"}, //0000码代表此时是初始化数据
				success:function(msg){
					console.log("yi次初始化 - " + msg) ;
					//type
					//变动数据
					if($$.util.isJSON(msg)){
						var object = Tokener.parseObject(msg) ;
						$(".dear_boss")[0].text("亲爱的"+object.get("dearBoss")+",晚上好！") ;
						merchant.initStrategy(object.get("initData"), object.get("type")) ;
						merchant.nextInitPage() ;//进行二次初始化
					}else console.log("数据异常") ;
				},
				error:function(msg){
					console.log(msg) ;
				}
			}) ;
		},
		nextInitPage:function(){	//二次初始化
			ajax({
				type:"post",
				url:"merchantManage_initPage",
				data:{data:"0001"}, //0001码代表此时是二次初始化数据
				success:function(msg){
					//type
					//变动数据
					console.log("二次初始化 - " + msg) ;
					if($$.util.isJSON(msg)){
						var object = Tokener.parseObject(msg) ;
						var map = merchant.initData ;
						var entry = map.entrySet() ;
						for(var item in entry){
							var key = entry[item].getKey ;
							var value = entry[item].getValue ;
							console.log(key + " - " + value) ;
							var object_ = object.get(key) ;
							if(object_ != undefined)
								merchant.initStrategy(object_, value, key) ;
						}
					}else console.log("数据异常") ;
				},
				error:function(msg){
					alert(msg) ;
					console.log(msg) ;
				}
			}) ;
		},
		initStrategyAdd:function(){
			
		},
		initStrategy:function(object, typeCode){	//初始策略
			var index = 0 ;
			switch(typeCode){
				case "0000" : 
				merchant.initOrder(object) ;
				break ;
				case "0001" :
				merchant.initSales(object) ;
				index = 1 ;
				break ;
				case "0002" :
				merchant.initGoods(object) ;
				index = 2 ;
				break ;
				case "0003" :
				merchant.initInfo(object) ;
				index = 3 ;
				break ;
				default : alert("数据异常") ;
			}
			if(merchant.firstBool){
				merchant.leftNav(index) ;//初始化左边导航样式
				merchant.rightContent() ;//初始化右边的样式
				merchant.firstBool = false ;
			}
		},
		initData:new Map(),						//nextInitPage
		initGoods:function(arrObject){			//initStrategy
			var it = arrObject.itarator() ;
			while(it.hasNext()){
				var obj = it.next() ;
				$("#goods_list").insert(merchant.goodsMudle(obj.get("id"), obj.get("imgPath"), obj.get("name"), obj.get("price"), obj.get("sizes"), obj.get("colors"))) ;
			}
			$(".close_ico")[0].css("background: url('" + merchant.pictureData.RIGHT_CLOSE + "'); position: absolute; right: 0px; cursor: pointer;", false) ;
			refresh () ;
		},
		initOrder:function(arrObject){			//initStrategy
			manage1(arrObject) ;
		},
		initSales:function(arrObject){			//initStrategy
			
		},
		initInfo:function(infor){				//initStrategy
			$(".manage_con")[0].$(".storeName")[0].value = infor.get("mName") ;
			$(".manage_con")[0].$(".integral")[0].value = infor.get("integral") ;
			$(".manage_con")[0].$(".trueName")[0].value = infor.get("trueName") ;
			$(".manage_con")[0].$(".sex")[0].value = infor.get("sex") ;
			$(".manage_con")[0].$(".pNumber")[0].value = infor.get("pNumber") ;
			$(".manage_con")[0].$(".email")[0].value = infor.get("email") ;

			var addresss = infor.get("address") ;
			var it = addresss.itarator() ;
			var code = "" ;
			while(it.hasNext()){
				var address = it.next() ;
				code += merchant.addressMudle.makeHTML(address.get("id"), address.get("province"), address.get("city"), address.get("street"), false) ;
			}
			$(".manage_con")[0].$(".add-label")[0].appendTop(code) ;
		},
		goodsMudle:function(id, imgPath, name, price, sizes, colors){
			return '<tr class="" data-id="'+id+'">' +
					'<td>' + 
						'<img src="../'+imgPath+'" width="55" height="60" alt="" title="点击更换图片">' +
					'</td>' +
					'<td><input type="text" value="'+name+'"></td>' +
					'<td><input type="text" value="'+price+'"></td>' +
					'<td><input type="text" value="'+sizes+'"></td>' +
					'<td><input type="text" value="'+colors+'"></td>' +
					'<td class="oprate_td"><i class="update_i"></i></td>' +
					'<td class="oprate_td"><i class="delete_i"></i></td>' +
					'<td class="oprate_td">' +
						'<i class="sure_i" style="display:none;" title="确认修改"></i>' +
					'</td>' +
				'</tr>' ; 
		},
		addressMudle:new MerchantAddress(),
		pictureData:{
			//RIGHT_CLOSE	用于关闭添加商品栏
			//NEW_MESSAGE	用于消息提醒
			RIGHT_CLOSE:"",
			NEW_MESSAGE:"",
		},
		init:function(){  //页面的初始化   initPage是页面后台数据的提取达到初始化
			
		},
		
		ajax:{
			updateInfor:function(jsonStr){
				//jsonStr JSON格式的数据传递到后台
				ajax({
					type:"post",
					url:"merchantManage_updateInfor",
					data:{data:jsonStr,},
					success:function(msg){
						//是否修改成功
						console.log(msg) ;
					},
					error:function(msg){
						console.log(msg) ;
					}
				}) ;
				
			},
			sureDeliver:function(jsonStr, Ele){
				//jsonStr	商户订单的id logistId
				ajax({
					type:"post",
					url:"merchantManage_confirmDelivergoods",
					data:{data:jsonStr,},
					success:function(msg){
						console.log(msg) ;
						Ele.remove() ;
						if($$.util.isJSON(msg)){
							merchant.orderManage($$.json.toObject(msg)) ;
						}else console.log("异常数据为：" + msg) ;
					},
					error:function(msg){console.log(msg) ;}
				}) ;
			},
			deleGoods:function(id){
				//	商品id
				ajax({
					type:"post",
					url:"merchantManage_deleGoods",
					data:{data:id,},
					success:function(msg){
						console.log("删除成功") ;
					},
					error:function(msg){
						console.log("删除失败") ;
					}
				}) ;
			},
			updateGoods:function(jsonStr){
				//jsonStr	JSON格式的数据
				ajax({
					type:"post",
					url:"merchantManage_updateGoods",
					contentType:'application/x-www-form-urlencoded; charset=utf-8',
					data:{data:jsonStr,},
					success:function(msg){
						console.log(msg) ;
					},
					error:function(msg){
						console.log(msg) ;
					}
				}) ;
			},
			addAddress:function(jsonStr){
				//jsonStr 地址信息
				ajax({
					type:"post",
					url:"merchantManage_",
					contentType:'application/x-www-form-urlencoded; charset=utf-8',
					data:{data:jsonStr,},
					success:function(msg){
						//返回地址id
						console.log(msg) ;
					},
					error:function(msg){
						console.log(msg) ;
					}
				}) ;
			}
		},
		orderManage:function(data){
			manage1(data) ;
		},
		newMassage:function(){
			//可以借用nextInitPage的格式
			//取到一个对象
			//可能装有 新订单 0000
		},
	}	

	//请求初始数据
	merchant.initPage() ;
	merchant.init() ;
	
	/* S 商品 */
	//初始化商品列表
	//将input设置为disabled = true
	function refresh () {
		var text = $(".goods_con")[0].$("table")[0].$("input") ;
		for(var i = 0; i < text.length; i ++) text[i].disabled = true ;
	}
	var isDisabled = false ;	//是否需要设置Input的disabled

	//委托的方式处理修改和删除的点击事件
	trEventclick () ;
	function trEventclick (){
		var preTr ;
		$(".goods_table")[0].onclick = function(e){
			if(e.target.tName() == "i"){
				var trEle = e.target.parent("tr") ;  // 获取父元素tr
				if(e.target.attr("class") == "update_i"){
					console.log(trEle.attr("data-id")) ;
					if(trEle != undefined && trEle.attr("data-id").length > 0){
						trEle.$(".sure_i")[0].style.display = "block" ;
						var input = trEle.$("input") ;				//获取所有的input
						for(var i = 0; i < input.length; i ++) input[i].disabled = false ;
						isDisabled = true ;
					}else
						console.log("不允许修改") ;
					preTr = trEle ;
				}
				if(e.target.attr("class") == "delete_i"){
					console.log(trEle.attr("data-id")) ;
					var id = trEle.attr("data-id") ;
					if(trEle.attr("data-id").length > 0){
						trEle.remove() ;
						merchant.ajax.deleGoods(id) ;	
						/*
						ajax({
							type:"post",
							url:"merchantManage_deleGoods",
							data:{data:id,},
							success:function(msg){
								console.log("删除成功") ;
							},
							error:function(msg){
								console.log("删除失败") ;
							}
						}) ;
						*/
					}
					else console.log("不允许修改") ;
				}
				if(e.target.attr("class") == "sure_i"){
					var inputs = preTr.$("input") ;
					console.log("确认修改") ;
					var len = inputs.length ;
					var object = new JSONObject() ;
					object.put("id", trEle.attr("data-id")) ;
					object.put("name", inputs[0].value) ;
					object.put("price", inputs[1].value) ;
					object.put("sizes", inputs[2].value) ;
					object.put("colors", inputs[3].value) ;
					console.log(" - " + new JSONTokener().parseString(object)) ;
					merchant.ajax.updateGoods(object.toString()) ;
					/*
					ajax({
						type:"post",
						url:"merchantManage_updateGoods",
						contentType:'application/x-www-form-urlencoded; charset=utf-8',
						data:{data:(new JSONTokener().parseString(object)),},
						success:function(msg){
							console.log(msg) ;
						},
						error:function(msg){
							console.log(msg) ;
						}
					}) ;
					*/
					e.target.style.display = "none" ;
				}
			}else if(e.target.tName() == "img"){		//修改图片
				var trEle = e.target.parent("tr") ;		// 获取父元素tr
				if(e.target.tName() == "img"){

					var eTarget ;
					if(trEle.attr("data-id").length > 0){
						eTarget = e.target ;
						$(".id-text")[0].value = trEle.attr("data-id") ;
						$(".upload")[0].click() ;
					}else
						console.log("该项不允许改动") ;
					//图片的修改FormAjax
					$$.formAjax({
						formEle:$("#f_upload"),
						success:function(msg){
							console.log(msg) ;
							eTarget.src = "../"+msg ;
						},
						error:function(msg){
							console.log(msg) ;
						}
					}) ;
				}
			}
		}
	}
	/*
	滑进一个tr会设置新的样式 并恢复下一个tr的样式
	*/

	trEventOver () ;
	//委托的方式处理
	function trEventOver (){
		var preTr ;
		var trFlag = false ;  //是否移至下一个tr
		var trOne = true ;    //限制运行一次
		var trEle ;
		$(".goods_table")[0].onmouseover = function(e){
			if(e.target.nodeName == "TD"){
				if(trOne){
					trEle = e.target.parentNode ;
					trOne = false ;
					overCss(trEle) ;
					preTr = trEle ;
				}
			}
			if(trEle != undefined)
				trFlag = e.target.isParentNode(trEle) ;
			if(e.target.nodeName == "TD"){
				if(!trFlag){
					trEle = e.target.parentNode ;
					if(preTr != undefined)
						outCss(preTr) ;
					preTr = trEle ;
					overCss(trEle) ;
				}
			}	
		}
		//恢复样式
		function outCss(e){
			e.css("box-shadow:none; ", false) ;
			e.$(".update_i")[0].css("background:url(../image/manage/update.png);", false) ;
			e.$(".delete_i")[0].css("background:url(../image/manage/dele.png);", false) ;
			e.$(".sure_i")[0].css("display:none;", false) ;
			if(isDisabled){
				isDisabled = false ;
				var input = e.$("input") ;
				for(var i = 0; i < input.length; i ++){
					input[i].disabled = true ;
				}
			}
		}
		//滑过样式
		function overCss(e){
			e.css("box-shadow:1px 1px 8px -1px #555; ", false) ;
			e.$(".update_i")[0].css("background:url(../image/manage/update_hover.png);", false) ;
			e.$(".delete_i")[0].css("background:url(../image/manage/dele2.png);", false) ;
		}
	
	}
	//.goods_con > .more-oprate > .manage-update:hover .add-con{height:64px; width:657px;}
	var addConAni = new AnimateBevelAngle({
		aniEle:$(".goods_con")[0].$(".add-con")[0],	//动画元素
		aniMax:64,		//最大动画值  在动画中代表元素的高
		widthVal:688,	//宽
		initTop:45,		//距离top
		type:"R_B",		//动画方向 左上
		initLeft:0,	//距离左边
	}) ;
	
	//添加商品按钮点击事件
	$(".goods_con")[0].$(".manage-update")[0].onclick = function(){
		addConAni.run() ;
		$(".goods_con")[0].$(".manage-update")[0].style.display = "none" ;
		$(".goods_con")[0].$(".manage-sure")[0].style.display = "block" ;
	}
	//确认添加按钮点击事件
	$(".goods_con")[0].$(".manage-sure")[0].onclick = function(){
		$(".goods-submit")[0].click() ;
		addConAni.next() ;
		$(".goods_con")[0].$(".manage-sure")[0].style.display = "none" ;
		$(".goods_con")[0].$(".manage-update")[0].style.display = "block" ;
	}
	//关闭按钮
	$(".close_ico")[0].onclick = function(e){
		console.log(e.target.tName() + " - " + e.target.attr("class")) ;
		addConAni.next() ;
		$(".goods_con")[0].$(".manage-sure")[0].style.display = "none" ;
		$(".goods_con")[0].$(".manage-update")[0].style.display = "block" ;
	}
	$("#uploadImg").onclick = function(){
		$("#imgFile").click() ;
	}
	
	//添加商品 FormAjax
	$$.formAjax({
		formEle:$("#f_goods"),
		success:function(msg){
			var str = maGoods.makeHTML("", msg, $(".goods-name")[0].value, $(".goods-price")[0].value, $(".goods-sizes")[0].value, $(".goods-colors")[0].value) ;
			$("#goods_list").insert(str) ;
			$(".goods-reset")[0].click() ;
			refresh () ;
		},
		error:function(msg){
			console.log(msg) ;
		}
	}) ;
	

	
	/* E 商品 */

	//订单管理对象
	function manage1(objArr){
		if(objArr.length() > 0){
			var it = objArr.itarator() ;
			while(it.hasNext()){
				var of = new OrderFactory_1() ;

				var objData = it.next() ;

				var baseData = objData.get("obj") ;
				var orderObject = of.createOrder(baseData) ;		//创建订单

				var busiData = objData.get("busi") ;

				var busiObject = of.createBusinessMange(busiData) ;	//创建商店信息
				var goodsDatas = busiData.get("goods") ;   //获取商品
				var goodsDataIt = goodsDatas.itarator() ;
				while(goodsDataIt.hasNext()){
					var goodsData = goodsDataIt.next() ;
					var goodsObject = of.createGoods(goodsData) ;	//创建订单中的商品
					busiObject.add(goodsObject) ;
				}
				orderObject.add(busiObject) ;

				var Ele ;
				var deliveBool = busiData.get("deliveryState") ;  //是否发货
				var fieldRan = $$.util.getRan() ;	//随机生成的字段 将作为是否发货的key值
				if(deliveBool){
					if(busiData.get("progressState")){
						//完成
						console.log("完成") ;
						Ele = $(".order_ed")[0].$("ul")[0].insert("<li>" + orderObject.makeHTML() + "</li>") ; 
					}else{
						//未完成
						console.log("未完成") ;
						Ele = $(".order_ing")[0].$("ul")[0].insert("<li>" + orderObject.makeHTML() + "</li>") ; 
					}
				}else{
					//待确认
					console.log("待确认") ;
					Ele = $(".order_new")[0].$("ul")[0].insert("<li>"+ orderObject.makeHTML() +"</li>") ; 
					//选择发货地址
					Ele.$(".select_address")[0].onchange = function(e) {
						var option = e.target.$("option")[e.target.selectedIndex] ;
						Ele.$(".ship_address")[0].attr("data-id", option.attr("data-id")) ;
						Ele.$(".ship_address")[0].text(option.value + " (发货地址)") ;
						merchant.parame.put(fieldRan, true) ;
						e.target.style.display = "none" ;
					}
				}
				console.log(Ele) ;
				var ani = new AnimateRoutine({
					aniEle:Ele.$("ul")[0].$(".li_bom")[0],
					aniMin:16,
					aniMax:50,
					closeAll:false,
					type:"bottom",
				}) ;
				var openBool = true ;
				Ele.onclick = function (e){
					//新订单进行发货确认
					if(e.target.attr("class") == "more_infor"){
						if(openBool){
							openBool = false ;
							ani.run() ;
						}else{
							openBool = true ;
							ani.next() ;
						}
					}
					//确认发货
					if(e.target.attr("class") == "sure_order" && deliveBool){
						if(!merchant.parame.get(fieldRan)){
							alert("请选择发货地址！！！") ; 
							return ;
						}
						console.log("确认发货") ;
						var parent = e.target.parent("div") ;
						while(parent.attr("class") != "order"){
							parent = parent.parent("div") ;
						}
						var jObj = new JSONObject() ;
						jObj.put("id", parent.attr("data-id")) ;
						jObj.put("logistId", parent.$(".ship_address")[0].attr("data-id")) ;
						merchant.ajax.sureDeliver(jObj.toString(), Ele) ;
					}
					//修改发货地址
					if(e.target.attr("class") == "update_"){
						
					}
				}
				
			}
		}
		
	}
	//
	var openBool = true ;
	//新的订单所有点击委托
	$(".order_new")[0].onclick = function(e){
		
		/*if(e.target.attr("class") == "more_infor"){
			if(openBool){
				openBool = false ;
				ani.run() ;
			}else{
				openBool = true ;
				ani.next() ;
			}
		}*/
		//点击确认发货
	}

	/* E 订单的处理 */
	
	/* S 商铺的信息管理 */
	//修改
	styleFun(true, "#fff") ;
	$(".manage_con")[0].$(".manage-update")[0].onclick = function(){
		styleFun(false, "#f6f4f0") ;
		$(".manage_con")[0].$(".manage-update")[0].style.display = "none" ;
		$(".manage_con")[0].$(".manage-sure")[0].style.display = "block" ;
		$(".manage_con")[0].$(".address-con")[0].$(".add")[0].style.display = "block" ;
	}
	//确认
	$(".manage_con")[0].$(".manage-sure")[0].onclick = function(){
		styleFun(true, "#fff") ;
		$(".manage_con")[0].$(".manage-sure")[0].style.display = "none" ;
		$(".manage_con")[0].$(".manage-update")[0].style.display = "block" ;
		$(".manage_con")[0].$(".address-con")[0].$(".add")[0].style.display = "none" ;
		merchant.ajax.updateInfor(getAddressInfor()) ;
	}
	//样式的改变-是否修改信息时
	function styleFun(disBool, styleColor){
		var inputs = $(".manage_con")[0].$("input") ;
		var len = inputs.length ;
		for(var i = 0; i < len; i ++){
			if(inputs[i].attr("type") == "text"){
				inputs[i].disabled = disBool ;
				inputs[i].style.background = styleColor ;
			}
		}
		var selects = $(".manage_con")[0].$(".address-con")[0].$("select") ;
		var len_ = selects.length ;
		for(var i = 0; i < len_; i ++){
			selects[i].disabled = disBool ;
			selects[i].style.background = styleColor ;
		}
	}
	//取消修改

	//添加新地址
	$(".manage_con")[0].$(".address-con")[0].$(".add")[0].onclick = function(e){
		var label = $(".manage_con")[0].$(".add-label")[0].appendTop(merchant.addressMudle.makeHTML("","", "", "", true)) ;
	}
	//初始化信息
	/**ajax({
		type:"post",
		url:"merchantManage_merchantInforInit",
		success:function(msg){
			if(isJSON(msg)){
				//{"trueName":"\u9648", "address":[{"province":"\u5e7f\u4e1c", "city":"\u5e7f\u5dde", "street":"\u767d\u4e91", "id":1}], "integral":0, "sex":"\u7537", "mName":"\u4e3b\u5bb6", "pNumber":"13430394603", "email":"1281384046@qq.com"}
				var infor = Tokener.parseObject(msg) ;
				
			}else{
				alert("信息初始化异常") ;
			}
		},
		error:function(msg){
			alert("异常") ;
		}
	}) ;*/
	/*
	获取地址的修改信息
	*/
	function getAddressInfor(){
		var object = new JSONObject() ;	
		object.put("storeName", $(".storeName")[0].value) ;	
		object.put("trueName", $(".trueName")[0].value) ;
		object.put("sex", $(".sex")[0].value) ;
		object.put("pNumber", $(".pNumber")[0].value) ;
		object.put("email", $(".email")[0].value) ;
		var arr = new JSONArray() ;
		var addressElements = $(".address_infor") ;
		var len = addressElements.length ;
		for(var i = 0; i < len; i++){
			var obj = new JSONObject() ;
			addressEle = addressElements[i] ;
			obj.put("id", addressEle.attr("data-id")) ;
			obj.put("province", addressEle.$(".province")[0].value) ;
			obj.put("city", addressEle.$(".city")[0].value) ;
			obj.put("street", addressEle.$(".street")[0].value) ;
			arr.add(obj) ;
		}
		object.put("address", arr) ;
		return object.toString() ;
	}

	//地址模板
	function MerchantAddress(){
		this.disCode = function(){
			return "disabled" ;
		}
		this.proCode = function(){
			return "" ;
		}
		this.cityCode = function(){
			return "" ;
		}
		this.makeHTML = function(id, province, city, street, flag){
			return '<label class="address_infor" data-id="' + id + '">'+
									'<label>'+
										'<select class="select-button input_address province" '+ (flag ? "" : this.disCode()) +'>'+
											'<option>'+ province +'</option>'+
											this.proCode()+
										'</select>'+
									'</label>'+
									'<label>'+
										'<select class="select-button input_address city" '+ (flag ? "" : this.disCode()) +'>'+
											'<option>'+ city +'</option>'+
											this.cityCode()+
										'</select>'+
									'</label>'+
									'<label>'+
										'<input class="input-text input_address street" '+ (flag ? "" : this.disCode()) +' type="text" value="'+street+'"/>'+
									'</label>'+
								'</label>' ;
		}
	}

	/**
	左栏
	liElements
	cntElements
	*/
	function liEvent_2(data){
		LiEventSuper.call(this, data) ;
		new InheritSupport().support(this, new LiEventSuper(data)) ;

		this.overEventCss = function (i){
			data.liElements[i].css("background:#555; color:#fff;", false) ; 
		}
		//当前移出样式设置
		this.outEventCss = function (i){
			data.liElements[i].css("background:#f6f4f0; color:#555;", false) ; 
		}
		//e {i:preIndex}
		this.preClickFun = function (i){
			data.liElements[i].css("background:#f6f4f0; color:#555;", false) ;
			data.cntElements[i].css("display:none;", false) ;
		}
		//设置当前的元素 
		//e {i:i}
		this.nowClickFun = function (i){
			data.liElements[i].css("background:#555; color:#fff;", false) ;
			data.cntElements[i].css("display:block;", false) ;
		}
	}
	</script>
 </body>
</html>